import { merge } from 'webpack-merge'
import webpack, { Configuration } from 'webpack'
import webpackProd from "./webpack.prod";
import webpackDev from "./webpack.dev";
import webpackCommon from "./webpack.common";
export default (env: Record<string, boolean | string | number>): Configuration => {
    console.log('env', env);
    const isProd = env.production === true
    if (isProd) {
        return merge(webpackCommon, webpackProd)
    }else {
        return merge(webpackCommon, webpackDev)
    }
}